Single-shot polarimetry of vector beams by supervised learning

States of light encoding multiple polarizations - vector beams - offer unique capabilities in metrology and communication. However, their practical application is limited by the lack of methods for measuring many polarizations in a scalable and compact way. Here we demonstrate polarimetry of vector beams in a single shot without any polarization optics. We map the beam polarization content into a spatial intensity distribution through light scattering and exploit supervised learning for single-shot measurements of multiple polarizations. We characterize structured light encoding up to nine polarizations with accuracy beyond 95% on each Stokes parameter. The method also allows us to classify beams with an unknown number of polarization modes, a functionality missing in conventional techniques. Our findings enable a fast and compact polarimeter for polarization-structured light, a general tool that may radically impact optical devices for sensing, imaging, and computing.

Generating, manipulating, and detecting the optical state of polarization (SOP) is of paramount importance in many areas, such as optical communication 1 , sensing 2 , microscopy 3 , and quantum information and computation 4 . While progress in material growth and nanotechnology are enabling advances in active polarization control [5][6][7] , the measurement of light polarization remains limited by its intrinsic vectorial nature. Complete determination of a single SOP needs at least four individual measurements, each projecting the state on a distinct vector [8][9][10] . Conventional polarimetry methods replicate in time or space the polarization analyzer, which results in bulky optical setups, or in costly compact polarimeters based on metasurfaces [11][12][13][14][15][16][17][18] . While for uniformly-polarized light the need for several measurements is still affordable and can be mitigated by using specific optical devices 19 , it becomes a serious issue for beams with a spatial polarization structure.
In this article, we demonstrate compact single-shot measurements of multiple polarizations by photonic machine learning. We map the beam polarizations into a complex spatial distribution of intensity corresponding to a point in a high-dimensional feature space. Then, supervised learning extracts polarization information from the intensity data. The critical point is that we avoid projecting on a polarization basis and perform no direct operation on the polarization state. The method thus removes the need for polarization optics and engineered devices in polarization imaging. We report accurate measurements of various beams encoding multiple SOP, including the case in which the number of polarization modes is unknown and inferred by the measurements. An unexpected outcome is the experimental evidence of the double descent, a phenomenon that is attracting attention in machine learning 35 . The double descent increases the classification accuracy when the dimension of the feature space is large. This effect improves the observation fidelity of the multiple SOP and enables high-precision measurements.

Results
Single-shot polarimetry via light scattering and learning Figure 1 reports our methodology. We show a representation of the SOP given by the four-component vector |si = |S 1 , S 2 , S 3 , S 0 , with Stokes parameters S i . The system phase space is the unit sphere, known as the Poincaré-Bloch (PB) sphere. A projective measurement returns the components of the incident state |si in a set of analysis vectors (Fig. 1a). Given a minimal set of four independent detected optical powers |p = |p 1 , p 2 , p 3 , p 4 , the measured state is obtained as |s m =P À1 |p , whereP is the instrument matrix 9,10 .
In our single-shot polarimetry (Fig. 1b), the light beam interacts with a physical object that transforms the input polarization into a set of features. The object can be any polarization-dependent optical system, such as a diffractive element, a disordered medium, etc., and its details can be unknown to the observer. The feature set at the readout is composed of an ensamble of different observable quantities. Specifically, we consider the field intensity at different n spatial positions. An intensity measurement collects the values |xi = |x 1 , x 2 ,:::, x n . The polarization state is determined by a linear operation as where theβ operator is a 4 × n matrix, which we refer to as the calibration matrix of the instrument. Crucially,β is not determined apriori, but retrieved by experimental data via machine learning.
The key point of our single-shot method is the redundant mapping of a polarization state, determined by four observables, to a state belonging to a much larger space, defined by n observables. If n is very large, the redundancy makes the method very advantageous to measure light beams that encode many polarizations in distinct spatial optical modes (vector beams). We consider a beam containing D different polarization states. The corresponding multiple SOP can be expressed as |si = |s 1 È |s 2 È ::: È |s D , where |s j denotes the Stokes vector of the j-th mode. The observation of multiple SOP with conventional polarization tomography requires at least 4D projections or 4D generalized measurements 34 . On the contrary, we observe the state |s o , composed of D individual SOP, with a single-shot measurement by using the higher-dimensional data vector |xi. The necessary calibration matrixβ of size 4D × n is determined by an initial training phase. The scheme is scalable with the dimension D of the multiple SOP, at variance with projective measurement setups where additional detectors are required. In our case, we can observe input states |si of variable dimension by adopting a unique feature space. This property means we can obtain, through the same detected signal, additional beam parameters otherwise difficult to access.
Single-shot polarimetry is experimentally implemented by using the scheme illustrated in Fig. 2. The optical setup is composed of two parts: a generator that produces vector beams and a single-shot polarization analyzer that realizes the optical transformation and collects the resulting intensity (details in Methods). To generate multiple SOP we exploit a phase-only spatial light modulator (SLM). This allows shaping a large number of different polarizations on the wavefront of a single λ = 532 nm laser beam, with distinct states |s j that correspond to spatially-separated modes with phase ϕ j (see Supplementary Note 1). The single-shot analyzer exploits light scattering 36 . In fact, it is known that multiple scattering from random media can be harnessed to perform deterministic operations on an incident electromagnetic field 37 . The idea have resulted in optical instruments based on disorder, such as lenses 38 , polarimeters 39 , beam analyzers 40 , and compact spectrometers 41 , but also in effective schemes for optical computing 42 . In our experiment, we use light scattering from a glass diffuser to map the SOP into intensity data. The scattering medium spatially mixes the impinging optical field and transmits a disordered field. The resulting speckle pattern is imaged on a camera sensor with no polarization filters. The entire polarization content of the incoming beam is hidden within this intensity distribution. However, at variance from disorderbased photonic instruments [39][40][41] , our method does not require determining the transmission operator to perform the measurement. We simply get an image whose spatial details depend on the polarizations of the vector beam. By sampling the image, we obtain the output data |xi, which encodes the input polarizations into a higher-dimensional feature space. The mapping can be performed by any optical system , a point on the Poincaré-Bloch sphere, is processed by distinct detectors, each analyzing one component. b In our single-shot method, the SOP is mapped onto a high-dimensional phase space (false-color map) where data were collected. The black box represents the transformation setup, i.e., any optical system with a polarization-dependent response: disordered media, nonlinear materials, optical devices, etc. The SOP is identified in the feature space by supervised learning. When measuring a vector beam composed by 1, 2, ..., D different polarizations, the projective analysis necessitates 4D measurements, while we use a single intensity distribution embedding all information.
sensitive to the input polarization such as optical fibers and nonlinear materials.
To understand the role of coupling between polarization and spatial degrees of freedom, we differentiate two cases. For D = 1, a necessary working condition is a scatterer that couples polarization and amplitude spatial modes. In fact, different input SOP have to result in distinguishable intensity distributions to obtain distinct measurement outcomes. Surprisingly, for vector beams (D > 1), coupling generated by the scatterer is no longer necessary. In this case, the partitioning of the impinging beam induces sufficient interaction (see Supplementary Note 2). In experiments, we vary the polarizationspatial coupling by testing glass diffusers of various roughness, which induce a different amount of depolarization 43 . We found comparable performance in all the considered samples. Hereafter, we report results in the case of small coupling, corresponding to transmitted light with a degree of polarization close to one (see Supplementary Note 3).
To extract polarization information from the intensity data, we use supervised learning. Among the various neural network architectures that have been proved convenient for optical systems 44 , we adopt the extreme learning machine (ELM) 45 . ELM allows fast and easy training with several thousands of network nodes, thus being especially suited to large-scale photonic implementations [46][47][48][49][50][51][52][53][54] . To apply the ELM algorithm, we construct a readout layer by a random selection of 4M output camera channels (Fig. 2b). Each channel has a linear weight β j i , with i = 1, ..., 4M and j = 1, ..., D, which form the calibration matrix in Eq. (1). Training consists in adjusting these parameters according to a labeled dataset via ridge regression (see Methods). Figure 3 shows the single-shot polarimetry of a single SOP. We generate N train samples randomly distributed on the PB sphere (Fig. 3a) and validate the calibrated single-shot analyzer on N test unknown SOP. As reported in Fig. 3b, the observed polarizations correspond to the input within a distance d = 0.014 ± 0.002 (see Methods). Each measured Stokes parameter S i is in remarkable agreement with its target value (Fig. 3c). The accuracy of the machine-learning polarimeter is investigated by varying the number of network channels M and the size N train of the calibration dataset. Results in Fig. 3d show the behavior of the Stokes error E(S i ). We find that single-shot measurements become extremely accurate when M increases (E(S i ) = 0.0075).

Machine-learning polarimeter
The observed error peak in Fig. 3d discloses the so-called double descent 35 . Above the interpolation threshold, the accuracy increases with the number of channels with no overfitting. We find that the interpolation threshold shifts with the training dataset size (Fig. 3d), with a maximum error for M ≃ N train . This point marks a critical condition in ELM made with physical systems 48 . Experimental observation of the double descent is made possible by the huge number of output nodes of our optical setup 54 . We exploit the effect to enhance the polarimeter precision. On the other hand, we underline that a few hundred channels are sufficient for effective measurements. Figure 3f shows the accuracy matrixâ, which also includes the degree of polarization ν. The single-shot results match well data from a conventional rotating-waveplate polarimeter. With reference to singlequbit tomography 55 , we obtain a fidelity F(ρ s , ρ m ) = 0.99 ± 0.01, where ρ s and ρ m are the density matrices obtained via single-shot and multiple projections.

Single-shot polarimetry of vector beams
In Fig. 4, we report single-shot polarization measurements of partitioned vector beams with four SOP. Calibration operates alike the single polarization case, but with N train states of dimension D = 4. Figure 4a shows the intensity of an unknown multiple SOP generated by four random phases ϕ i on four spatial modes. The effect of diffraction between adjacent SOP is visible. By collecting the transformed intensity image, we reveal the full polarization structure in a single shot, as shown by the polarization ellipses in Fig. 4b. Conventional projective polarization tomography (Fig. 4c) strikingly agrees with the single-shot observation. The overall uncertainty of the detection for D = 4 is evaluated in Fig. 4d by varying M up to 4M = 52,000 total channels. The error decreases with M, with localized peaks that indicate the interpolation threshold. The fidelity is confirmed by the overlap matrixâ in Fig. 4e, with Trâ À Á =4D = 0:95 accuracy.
We succeed in characterizing with high accuracy beams encoding up to nine SOP. This implies a single-shot reconstruction of a classical state |si lying in a 27-dimensional phase space. To implement larger systems, we expand the spatial extent of the input and output optical planes. Figure 5a shows the intensity of a beam encoding multiple SOP with D = 9. The result of the single-shot detection agrees with the state we get from multiple projections (Fig. 5b, c). The comparison, with thê a matrix having 1296 entries, gives a 0.91 overlap between the polarization states measured by using the two methods. The single-shot observation is hence performed with high precision, as also the measurement error in Fig. 5d indicates. Interestingly, we observe that the distance d decreases rapidly with M and gets stuck into a broad plateau. This behavior underlines the enormous complexity of the states that we are characterizing. Even if, in Fig. 5d, we do not observe any single-shot polarization analyzer vector beam generator interpolation threshold, as more output channels would be necessary, the method still enables accurate measurements.

Measuring the number of polarizations
In the most general case of an unknown multiple-polarization state, its dimension D is also an unknown variable. We demonstrate that we can identify the dimensionality of the multiple SOP. To train the setup, the calibration dataset includes beams with a variable number of partitions, and D as an additional target parameter. Figure 6a reports the confusion matrix obtained for vector beams having three possible partition configurations (D = 1, D = 4, and D = 9), with M = 10,000. The dimension is found with an accuracy that exceeds 98%. In addition, the set of Stokes parameters is measured with precision comparable to cases of known dimension (E(S i ) = 0.057). For D = 9, a comparison between the entire S i distribution is shown in Fig. 6b. Therefore, we not only perform single-shot polarimetry of beams encoding nine polarizations, but we carry out the measurement not knowing that the overall polarization vector has nine dimensions. It is important to note that dimension D is not directly measurable by using multiple projective measurements.

Discussion
We have experimentally demonstrated the measurement of multiple polarizations in a single shot without polarization optics. The result has been obtained with an original method that combines physical transformation between polarization and spatial degrees of freedom with machine learning to get unprecedented information in a single detection. This approach demonstrates photonic machine learning for a challenging optical application, i.e., polarization imaging.
Our measurement scheme has no bulky optical components and can operate at any wavelength. This allows to overcome the narrowband operation of all polarization cameras based on integrated devices and metasurfaces 17,18 . In our setup, both the scattering process and the learning procedure are efficient on a broad spectrum. As the transmitted intensity distribution is highly sensitive to the incoming spectrum, we expect our polarization imaging is able to operate on broadband light by training a wavelength-dependent instrument matrixβðλÞ. The single-shot polarimeter is hence compact, without moving components, broadband, and does not require nanofabrication. Moreover, it provides direct access to properties of the vector field otherwise difficult to quantify, as we demonstrate by measuring the unknown number of polarizations within the vector beam. The device can be developed further by using unsupervised learning methods such as variational autoencoders that generate Stokes parameter distributions from the detected sparse data.
These findings empower compact single-shot polarimetry based on machine learning in a wide variety of contexts, from optical networking to biomedical devices. We foresee the extension of our single-shot approach to the entire electromagnetic spectrum 56 , to subwavelength and topological optical fields, and, more generally, to other optical degrees of freedom 57 , with applications where conventional instruments are useless, as in edge devices and photonic chips 58 . Moreover, partitioned vector beams of quantum light can encode many qubits. Therefore, our results may also open exciting perspectives in the quantum domain, with the possibility to benefit from single-shot polarimetry by machine learning.

Experimental setup
The experimental setup follows the sketch in Fig. 2. A continuouswave laser beam with wavelength λ = 532 nm (LaserQuantum Ventus 532, 250 mW) is expanded and linearly polarized along the horizontal (H) direction (x-axis) with a linear polarizer (LP). The vector beam generator is composed of a reflective phase-only SLM (Hamamatsu X13138, 1280 × 1024 pixels, 12.5 μm pixel pitch, 60Hz frame rate) sandwiched between an input half-waveplate (HWP) and an output polarization system made by a quarter-waveplate (QWP) and HWP. The output waveplates are equipped with motorized precision rotation stages (MS) (25°/s maximum rotation velocity) that are programmed online. Their fast axes form respectively an angle α and β with the x-axis. The parameters α and β are varied with 2°resolutions during both training and testing. By grouping L × L SLM pixels, the modulator active area is divided into D squared input modes, with each mode having a phase ϕ j in the [0, 2π]  interval. The available phase levels are 210, distributed according to a linear phase response curve 59 . Polarization-modulated light is focused by a plano-convex lens (f = 150 mm) on a scattering medium (Thorlabs N-BK7 Ground Glass Diffusers, 1500 grit) positioned using a four-axis translational stage. The scattered field is collected by an imaging objective (NA = 0.25) and the transmitted speckle pattern is detected by a cooled camera (Basler a2A1920-160umPRO, 1920 × 1200 pixels, 160 fps) with 12-bit (4096 gray-levels) intensity sensitivity. Within the camera region of interest, 4M output channels are randomly pre-selected. The signal is obtained by binning over a few camera pixels (4 × 4 pixels) to reduce detection noise. Output channels have a size comparable to the spatial extent of a speckle grain. For reference measurements, a portion of the polarization-modulated beam is split and analyzed by using conventional polarimetry. A commercial rotating-waveplate polarimeter (PAX1000VIS, 0.25 ∘ accuracy) is used for a single SOP. For projective polarization imaging of vector beams, we use a custom rotating-waveplate analyzer composed of a QWP, an LP, and a CMOS camera (DCC1545M). Intensity projections are measured along the horizontal (H), vertical (V), diagonal (D), and right circular (R) components, i.e., p H , p V , p D , and p R are the detected power. An example of projective analysis for a partitioned vector beam is shown in Supplementary Fig. 2.

Training method
Calibration of the setup for single-shot polarization measurements is performed by generating N train vector beams and by loading one-byone the corresponding phase mask on the SLM. For the l-th training sample, the output waveplates of the vector beam generator are rotated to a couple of parameters α l and β l (Supplementary Note 1). The dataset fϕ j l ,α l ,β l g is randomly generated to cover the entire phase space. When the polarization dimension D need also to be determined, the training set is composed of states whose number of polarizations varies within the dataset. Intensity values from the 4M output channels are stored (Supplementary Fig. 6). We increase linearly the number of selected channels when increasing the dimension. In the case of D = 9, for the feasibility of training, we consider a maximum value of M = 13,000. For the measurement of multiple SOP with an unknown polarization number, M additional channels are used to reconstruct D. The calibration weights β j i are determined by applying the training algorithm to the entire set of acquired data. The obtained calibration matrixβ is used to measure N test random SOP. We use a ratio N test /N train = 0.1.

Extracting polarizations from intensity data
In our setup, the scattering medium creates a mapping between the incoming polarization set and a higher-dimensional feature space. This general mechanism underlies physical implementations of ELM and kernel machines for neuromorphic computing 47,49,52 . In our case, the scheme is trained to perform physical measurements. To determine the calibration matrixβ by using 4M output channels, we consider a training set of randomly-selected Stokes vectors f|sig S as target vectors (N train × 4D sized). The corresponding acquired intensity matrix is f|xig X, with size N train × 4M (M ≫ D). Training corresponds to solving numerically the ridge regression problem: where parameter c controls the trade-off between the training error and the regularization. A solution is given by 45 where I is the identity matrix. Inversion involves the 4M × 4M matrix X T X, which makes the method scalable as M is selected by the observer. Therefore, given an unknown multiple SOP and the corresponding single-shot intensity vector |xi, the observed state can be expressed as An explicit expression for x i is reported in Supplementary Note 2. In the case of a single SOP, the measured Stokes parameters from single-shot intensity data are Each S i is hence decoded through M weights. An example of both the acquired intensity and calibration matrix (c = 1) is reported in Supplementary Note 4.

Analysis of the measurements
To quantify the accuracy of the single-shot polarimeter, as a testing error on the i-th Stokes parameter, we use the mean-absolute-error (MAE) EðS i Þ = |S s i À S g i | , in which the apex stands for single-shot (s) and generated (g), and the average is over N test samples. Instead of S 0 , we report the degree of polarization ν = ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi S 2 1 + S 2 2 + S 2 3 q =S 0 , which quantifies the amount of unpolarized light. The distance between two SOP on the PB sphere is computed as d = ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffi P i EðS i Þ 2 q . The accuracy values with respect to projective measurements are a ij = 1 − O ij , with the overlap O ij = |S s i À S m i | , with apex m stands for multiple measurements. It is worth noting that this comparison includes also the inaccuracy of the SOP generator and the uncertainty of the conventional polarization analyzer ( Supplementary Fig. 2). For beams with a single SOP, the fidelity is computed in analogy with quantum state tomography as 55 Fðρ s ,ρ m Þ = Tr ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi ffiffiffiffiffiffi ρ m p ρ s ffiffiffiffiffiffi ρ m p p À Á 2 , where the density matrix is ρ = 1=2ð P i S iσi Þ with Pauli matricesσ i .

Reporting summary
Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article. b Single-shot measured versus generated Stokes parameters for beams of nine parts, whose dimension has been automatically identified.

Data availability
All relevant data that support the findings of this study are available within the article and supplementary information. Any additional data are available from the corresponding author upon request.

Code availability
The code used in the present study are available from the corresponding author upon request.